using System;
using System.Data;
using System.Configuration;
using System.Collections;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;
using System.Resources;
using System.IO;
using YABlog.BLL;

public partial class Admin_Settings : System.Web.UI.Page
{
    MetaDataAction metaAction = new MetaDataAction();
    UserActions userAction = new UserActions();

    protected void Page_Load(object sender, EventArgs e)
    {
        if (Session["UserId"] == null)
        {
            Response.Redirect("Login.aspx");
        }
    }
    protected void Button2_Click(object sender, EventArgs e)
    {
        Response.Redirect("default.aspx");
    }
    protected void Button1_Click(object sender, EventArgs e)
    {
        if (TextBox1.Text != "" && TextBox2.Text != "")
        {
            MetaDataBO meta = new MetaDataBO();
            meta.SITENAME = TextBox1.Text;
            meta.SUBTITLE = TextBox2.Text;

            if (metaAction.UpdateMetaData(meta))
            {
                Response.Redirect("Default.aspx");
            }
            else
            {
                //
            }
            
            
        }
    }
    protected void Button4_Click(object sender, EventArgs e)
    {
        Response.Redirect("default.aspx");
    }
    protected void Button3_Click(object sender, EventArgs e)
    {
        if (userAction.ValidateUser(TextBox3.Text, EncryptionManager.Encrypt(TextBox4.Text)))
        {
            if (userAction.UpdateUserDetails(TextBox3.Text, EncryptionManager.Encrypt(TextBox5.Text)))
            {
                Response.Redirect("default.aspx");
            }
        }
    }
}
